<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/include/base.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<link rel="shortcut icon" href="img/favicon.png"/>

<script  type="text/javascript"	src="static/js/pageComm.js"></script>
<script  type="text/javascript"	src="static/js/pageListComm.js"></script>
<script type="text/javascript">

	$(function(){
		
		//当页面完全加载后打开模态框
		openModal();
		function openModal(){
			//设置模态框标题
			$("#dictionaryLabel").text("字典内容查询");
			//
			$("#saveDictionary").html("查询");
			//设置name属性
			 $(".form-control").eq(0).attr("name","dictionaryName");
			 $(".form-control").eq(1).attr("name","typeId");
			 $(".form-control").eq(2).attr("name","dictionaryRemark");
			//加载所有的字典类型信息  放入多选框中
			 getAllDTypes("${APP_PATH}/dTypes","#dictorySelect select",true);
			$("#dictionaryModal").modal({
				backdrop: "static"
			});
		}
		
		
		
		
		//点击查询按钮  打开模态框
		$("#queryBtnModal").click(function(){
			openModal();
		});
		
		
		
		//根据所输入的信息查询信息
		$("#saveDictionary").click(function(){
			to_page(1);
			
		});
		
		
	});
	
	function to_page(pn){
	//	alert($("#dictionaryForm").serialize());
		$.ajax({
			url:"${APP_PATH}/dContentes/"+pn,
			data:$("#dictionaryForm").serialize(),
			success:function(result){
				//2. 解析并显示分页数据
 				  build_page_info(result);
 				 //3解析显示分页条
 				  build_page_nav(result);
 				 
      				//1. 解析并显示员工数据
 				 build_emps_table(result);
      				
      			//4关闭模态框
 				$("#dictionaryModal").modal("hide");
      			
			}
		});
	}

	//1. 解析并显示员工数据
		function build_emps_table(result){
			//清空table表格
	  		$("#queryDictionaryTable tbody").empty();
			//获取返回的dept值
			var dictionary=result.extend.pageInfo.list;
			

			$.each(dictionary,function(index,item){
				
				var dictionaryNameTd=$("<td></td>").append(item.dictionaryName);
				
				if(item.dType!=null && item.dType != ""){
					var dTypeNameTd=$("<td></td>").append(item.dType.dTypeName);
				}else{
					var dTypeNameTd=$("<td></td>");
				}

				var dictionaryRemark=$("<td></td>").append(item.dictionaryRemark);

				$("<tr></tr>").append(dictionaryNameTd)
							  .append(dTypeNameTd)
							  .append(dictionaryRemark)
							  .appendTo($("#queryDictionaryTable tbody"));
			});
	  	}
		
	
</script>

</head>


  <body>
  <!-- 模态框 -->
  <%@include file="/WEB-INF/include/dictionaryModal.jsp" %>
  
  <!-- container section start -->
  <section id="container" class="">
      <%@include file="/WEB-INF/include/top.jsp"%>

      <%@include file="/WEB-INF/include/left.jsp"%>

      <!--main content start-->
      <section id="main-content" >
          <section class="wrapper">
		  <div class="row">
				<div class="col-lg-12">
					<ol class="breadcrumb">
						<li><i class="fa fa-home"></i><a href="index.jsp">人员管理</a></li>
						<li><i class="fa fa-table"></i>查询结果列表</li>  
					</ol>
					
				
				</div>
			</div>
	          
             
            
              <div class="row" align="center" style="margin:0 auto">
                  <div class="col-lg-12">
                      <section class="panel">
                        
                          <table class="table table-striped table-advance table-hover" id="queryDictionaryTable">
                          <button id="queryBtnModal" type="button" class="btn btn-default  btn-block">查    询</button>
                          <thead align="center">
                         
                           <tr >
                                 <th width="37%" style="text-align: center;">字典名称</th>
                                 <th width="31%" style="text-align: center;">字典类型</th>
                                 <th width="32%" style="text-align: center;">注释</th>
                              </tr>
                          </thead>
                          		
                       
                          
                           <tbody align="center" >
                           </tbody>
                           <tfoot>
                           		<tr>
                           			<td colspan="10">
                           			
       <div class="row " >
				<!--分页文字信息  -->
				<div class="col-md-6" id="page_info_area"></div>
				<!-- 分页条信息 -->
				<div class="col-md-6" id="page_nav_area" >
				</div>
		</div>
                           			</td>
                           		</tr>
                           	
                           	
                           </tfoot>
                        </table>
                      </section>
                  </div>
              </div>
          </section>
      </section>
      <!--main content end-->
  </section>
  <!-- container section end -->
    <!-- javascripts -->
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <!-- nicescroll -->
    <script src="js/jquery.scrollTo.min.js"></script>
    <script src="js/jquery.nicescroll.js" type="text/javascript"></script>
    <!--custome script for all page-->
    <script src="js/scripts.js"></script>


  </body>
</html>
